﻿using Cxuu.Models;
using Cxuu.Service;
using Cxuu.Web.Authorize;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;

namespace Cxuu.Web.Admin
{
    [Area("Admin")]
    [Authorize]
    public class MenuController : Base
    {
        private readonly LoginUtil _LoginUtil;
        public MenuController(LoginUtil LoginUtil)
        {
            _LoginUtil = LoginUtil;
        }
        [HttpGet]
        [ActionPermissionFilter(Permission = PermissionKeys.Menu_Index)]
        public async Task<IActionResult> IndexAsync()
        {
            UserInfo userInfo = await _LoginUtil.UserInfoAsync();
            ViewBag.userInfo = userInfo;
            return View();
        }
        [HttpGet]
        [ActionPermissionFilter(Permission = PermissionKeys.Menu_Article)]
        public IActionResult Article()
        {
            return View();
        }
        [HttpGet]
        [ActionPermissionFilter(Permission = PermissionKeys.Menu_System)]
        public IActionResult System()
        {
            return View();
        }
        [HttpGet]
        [ActionPermissionFilter(Permission = PermissionKeys.ArticleExamine_Index)]
        public IActionResult Examine()
        {
            return View();
        }
        [HttpGet]
        [ActionPermissionFilter(Permission = PermissionKeys.Notice_Index)]
        public IActionResult Notice()
        {
            return View();
        }
        [HttpGet]
        [ActionPermissionFilter(Permission = PermissionKeys.Statistics_Index)]
        public IActionResult Statistics()
        {
            return View();
        }

        [HttpGet]
        [ActionPermissionFilter(Permission = PermissionKeys.Menu_Content)]
        public IActionResult Content()
        {
            return View();
        }
    }
}
